home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000058_icon-group-sender_Thu Mar 27 17:16:01 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2S0FrA08027
for icon-group-addresses; Thu, 27 Mar 2003 17:15:53 -0700 (MST)
Message-Id: <200303280015.h2S0FrA08027@baskerville.CS.Arizona.EDU>
From: voice_of_reason@australia.edu (Quiet Voice)
X-Newsgroups: comp.lang.icon
Subject: Befuddled by logic and an error message.....
Date: 27 Mar 2003 14:18:29 -0800
X-Complaints-To: groups-abuse@google.com
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Greetings:
Still in my endeavor to "re-learn" ICON, I have hit upon a bug that is
partially a logic bug and partially a runtime error.
What I am attempting to do is as follows --
A file is opened which contains text.
The idea of the program is to allow the user to selectively and
iteratively edit and re-edit the file and see the edits alongside the
original version of text.
The program creates and output file that holds the original text and
the current state of editing.
A line from the original file along with the corresponding edited line
are written to output.
With each pass thru the loop the idea is that the program opens a temp
file that holds the current editing. The user is essentially
iteratively editing the temp file.
Here's the code fragment along with comments I've written to
myself....
target := current text
edit := proposed edits
.
.
.
# LOGIC PROBLEM WITH THIS LOOP. NEED TO READ DATA FROM CURRENT GUESS
*THEN* SAVE NEW GUESS FOR
# FUTURE READ....but NEED TO PREVENT "INFINTIE LOOP" SITUATION OF
READING THEN WRITING THEN READING>>>>ETC
# CURRENT VERSION RESULTS IN RUN-TIME ERROR: 214 (???) in line 88
while (line := read(temp_holder)) do
{
orig := read(orig_text)
trial_line := map(line,target,edit)
write(output,"original: ",orig)
write(output," ")
write(output,"new: ",trial_line)
write(output," ")
OFFENDING LINE OF CODE ==> write(temp_holder,trial_line) # save
current trial set
}
write("TRIAL CORRECTIONS WRITTEN TO TEMPORARY FILE.")
writes("Do you have more corrections? Type yes or no: ")
more := read()
} #end INPUT loop
---
First of all, what sort of situations create a runtime error 214? What
am I doing wrong?
Secondly, any suggestions on how better to accomplish this?
Thanks for the advice and assitance.....